﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form2 : Form
    {
        delegate void SetTextCallback(string text);
        public void ChangeTextBox(string content)
        {
            if (this.RichTextBox1.InvokeRequired)
            {
                SetTextCallback d = new SetTextCallback(ChangeTextBox);
                this.BeginInvoke(d, new object[] { content });
            }
            else
            {
                RichTextBox1.Text = content + RichTextBox1.Text;
                RichTextBox1.Text = Environment.NewLine + RichTextBox1.Text;
            }
        }
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }

        private void Form2_FormClosed(object sender, FormClosedEventArgs e)
        {


        }

        private void Form2_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                e.Cancel = true;
                this.Hide();
            }
        }

        private void console_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
